using Digitalmes.Application.Scada.Events;

namespace Digitalmes.Application.Scada.EventHandlers;

/// <summary>
/// 产品出站后处理事件。
/// </summary>
internal sealed class AfterOutboundHandler(ILogger<AfterOutboundHandler> logger) : INotificationHandler<AfterOutboundEvent>
{
    public Task Handle(AfterOutboundEvent notification, CancellationToken cancellationToken)
    {
        try
        {
            // do somethings...
        }
        catch (Exception ex)
        {
            logger.LogError(ex, "[存档后处理事件异常] {SN}, 工位：{OpCode}",
                 notification.SN,
                 notification.WorkstationCode);
        }

        return Task.CompletedTask;
    }
}
